﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Guest.Master" AutoEventWireup="true"
    CodeBehind="Dashboard.aspx.cs" Inherits="ScrumLite.WebUx.MeasuresViews.Dashboard" Title="Measure Dashboard" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h1><%=ViewData.ProjectName %></h1>
    <hr />
    
    <div class="actions">
    <%=Html.ActionLink("Measures Description", "Description", "Measures") %>
    </div>
    
    <br />
    
    <% if (ViewData.Measures == null || ViewData.Measures.Count == 0) { %>

        There are no measures defined for the project <b>'<%=ViewData.ProjectName%>'</b> 
        at the process <b>'<%= ViewData.ProcessName%>'.</b>
           
    <% } else { %>
    
        <div class="formTable">
    	
	    <table cellpadding="0" cellspacing="0">
        <tr>
            <th>Measures</th>
            <th>Status</th>
        </tr>
        
        <% foreach (ScrumLite.Services.Contracts.Measure measure in ViewData.Measures)
           { %>
        <tr>
            <td>
                <%= string.Format("{0}: {1} {2}", measure.Name, measure.Value.ToString(), measure.Unit)%><br/>
                <%= string.Format("Last Measure: {0}", measure.LastMeasure.ToString("yyyy-MM-dd"))%>   
            </td>
            <td>
                <% switch (measure.Status)
                   {
                       case (ScrumLite.Services.Contracts.MeasureStatus.Good):
                        %>
                            <img alt="semaphore_green" src="/Content/images/semaphore_green.GIF" />
                        <% 
                            break;
                       case (ScrumLite.Services.Contracts.MeasureStatus.Regular):
                        %>
                            <img alt="semaphore_yellow" src="/Content/images/semaphore_yellow.GIF" />
                        <% 
                            break;
                       case (ScrumLite.Services.Contracts.MeasureStatus.Bad):
                        %>
                            <img alt="semaphore_red" src="/Content/images/semaphore_red.GIF" />
                        <% 
                            break;
                } %>
            </td>
        </tr>
        <% } %>   
           
        </table>
     
        </div>
    
    <% } %>
    
    <br />
    
    <div class="actions">
    <%=Html.ActionLink("Measures Description", "Description", "Measures") %>
    </div>
</asp:Content>
